import React from 'react';
import { connect } from 'dva';
import { Form } from 'antd';
import Comform from './Comform';

export default connect(({ commodity }: any) => ({ view: commodity.view }))(
  Form.create({
    mapPropsToFields(props: any) {
      return {
        name: Form.createFormField({
          value: props.view.name,
        }),
        comments: Form.createFormField({
          value: props.view.comments,
        }),
        id: Form.createFormField({
          value: props.view.id,
        }),
        reserveBalanceQty: Form.createFormField({
          value: props.view.reserveBalanceQty,
        }),
        saleQty: Form.createFormField({
          value: props.view.saleQty,
        }),
      };
    },
  })(Comform),
);
